home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / contrib / pdcurs22 / src / flexos / _8bitmod.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-26  |  2.1 KB  |  67 lines

  1. /*
  2. ***************************************************************************
  3. * This file comprises part of PDCurses. PDCurses is Public Domain software.
  4. * You may use this code for whatever purposes you desire. This software
  5. * is provided AS IS with NO WARRANTY whatsoever.
  6. * Should this software be used in another application, an acknowledgement
  7. * that PDCurses code is used would be appreciated, but is not mandatory.
  8. *
  9. * Any changes which you make to this software which may improve or enhance
  10. * it, should be forwarded to the current maintainer for the benefit of 
  11. * other users.
  12. *
  13. * The only restriction placed on this code is that no distribution of
  14. * modified PDCurses code be made under the PDCurses name, by anyone
  15. * other than the current maintainer.
  16. * See the file maintain.er for details of the current maintainer.
  17. ***************************************************************************
  18. */
  19. #define    CURSES_LIBRARY    1
  20. #include <curses.h>
  21.  
  22. #ifdef    PDCDEBUG
  23. char *rcsid__8bitmod  = "$Id$";
  24. #endif
  25.  
  26.  
  27.  
  28.  
  29. #ifdef    FLEXOS
  30. /*man-start*********************************************************************
  31.  
  32.   _flexos_8bitmode()    - Puts console into 8 bit mode.
  33.  
  34.   PDCurses Description:
  35.      This routine sets 8 bit mode (no 8 bit attribute) for Flexos.
  36.  
  37.   PDCurses Return Value:
  38.      This function returns OK on success and ERR on error.
  39.  
  40.   PDCurses Errors:
  41.      Under FLEXOS, an ERR will be returned if the s_get() call
  42.      fails, or if the s_set() call fails.  You are referred to
  43.      the Flexos Programmer's Reference Guide for details on the
  44.      actual error.
  45.  
  46.   Portability:
  47.      PDCurses    int _flexos_16bitmode( void );
  48.  
  49. **man-end**********************************************************************/
  50.  
  51. int    _flexos_8bitmode(void)
  52. {
  53. extern    VIRCON    vir;        /* Allocate a Virtual Console Structure */
  54.  
  55.     retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  56.     if (retcode < 0L)
  57.         return( ERR );
  58.  
  59.     vir.vc_kbmode = vir.vc_kbmode & ~VCKM_16BIT;
  60.     vir.vc_smode = vir.vc_smode & ~VCKM_16BIT;
  61.  
  62.     retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir));
  63.     return( (retcode < 0L) ? ERR : OK );
  64. }
  65. #endif
  66.